# blobs are being repacked
%define debug_package %{nil}
%global __requires_exclude ^lib(ffmpeg|EGL|GLES|vk_swiftshader|vulkan)
%global __requires_exclude_from (cortex-debug|musl)
%global __provides_exclude ^lib.*

Name:    arduino-ide
Version: 2.2.1
Release: 1

Summary: Arduino prototyping platform IDE, rewrite based on the Theia IDE framework  
License: AGPL-3.0
Group:   Development/Other
Url:     https://github.com/arduino/arduino-ide

Source0: https://github.com/arduino/arduino-ide/releases/download/%{version}/arduino-ide_%{version}_Linux_64bit.zip?/%{name}-%{version}.zip
Source1: arduino.svg
Source2: arduino-ide.rpmlintrc

Requires: libsoftokn3.so%{_arch_tag_suffix}

ExclusiveArch: x86_64

%description
The Arduino IDE 2.x is a major rewrite, sharing no code with the IDE 1.x.
It is based on the Theia IDE framework and built with Electron.
The backend operations such as compilation and uploading are offloaded to an
arduino-cli instance running in daemon mode. This new IDE was developed
with the goal of preserving the same interface and user experience of the
previous major version in order to provide a frictionless upgrade

%files
%_bindir/*
/opt/%name
%_datadir/applications/*.desktop
%_datadir/pixmaps/arduino-ide-v2.svg

%prep
%autosetup -p1 -n arduino-ide_%{version}_Linux_64bit

%build
#

%install
mkdir -p %buildroot/opt/%name
cp -r %_builddir/arduino-ide_%{version}_Linux_64bit/* %buildroot/opt/%name/

mkdir -p %buildroot%_bindir/
ln -rs %buildroot/opt/%name/arduino-ide %buildroot/%_bindir/arduino-ide

install -m644 -D %SOURCE1 %buildroot%_datadir/pixmaps/arduino-ide-v2.svg

mkdir -p %buildroot%_datadir/applications
cat > %buildroot%_datadir/applications/arduino-ide-v2.desktop <<EOF
[Desktop Entry]
Type=Application
Name=Arduino IDE v2
GenericName=Arduino IDE v2
Comment=Open-source electronics prototyping platform
Exec=arduino-ide %U
Icon=arduino-ide-v2
Terminal=false
MimeType=text/x-arduino;
Categories=Development;IDE;Electronics;
Keywords=embedded electronics;avr;microcontroller;
StartupWMClass=Arduino IDE
EOF
